/** 
* All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
* 
* PmPurchaseContractServiceAuto
* 外包合同申请
* 
* 修改纪录
* 2020-05-12 版本：1.0 shenyouyi 创建。
* @version 版本：1.0
* @author 作者：shenyouyi
* 创建日期：2020-05-12
*/

package com.topscomm.pm.service.impl.auto;

import javax.annotation.Resource;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;

import java.util.List;
import java.util.Map;
import com.topscomm.pm.*;
import com.topscomm.pm.pojo.PmPurchaseContractEntity;
import com.topscomm.pm.dao.IPmPurchaseContractDao;


public class PmPurchaseContractServiceAuto extends PmService<PmPurchaseContractEntity,IPmPurchaseContractDao> {
	
	/**
	 * @author: shenyouyi
	 * @date: 2020-05-12
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("projectid") != null) {
			temp = mapRow.get("projectid").toString();
			mapRow.put("dispprojectid", datacodeCache.getValueDynamic("PmProject", temp, "id", "name"));
		}
		if (mapRow.get("purchaseapplyid") != null) {
			temp = mapRow.get("purchaseapplyid").toString();
			mapRow.put("disppurchaseapplyid", datacodeCache.getValueDynamic("PmPurchaseApply", temp, "id", "name"));
		}
		if (mapRow.get("contracttype") != null) {
			temp = mapRow.get("contracttype").toString();
			mapRow.put("dispcontracttype", datacodeCache.getValueDynamic("PmPurchaseContractType", temp, "code", "name"));
		}
		if (mapRow.get("flowid") != null) {
			temp = mapRow.get("flowid").toString();
			mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_PmPurchaseContract", temp, "id", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}

		if (mapRow.get("courier") != null) {
			temp = mapRow.get("courier").toString();
			mapRow.put("dispcourier", datacodeCache.getValueDynamic("PmCourier", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "pmPurchaseContractDao")
	public void setDao(IBasicDao<PmPurchaseContractEntity> dao) {		
		super.setDao(dao);
	}
}
